<template>
    <div id="dialogSelectGoods">
        <el-dialog
            v-if="dialogFormVisible"
            :visible.sync="dialogFormVisible"
            :title="dialogTitle"
            width="620px"
            :close-on-click-modal="false"
        >
        <elTable ref="dataInfo" :enterSearch="true" :formData="formData" @tableData="getList">
                <el-table-column prop="goodsName" label="商品名称" align="center"></el-table-column>
                <el-table-column prop="productSpecification" label="规格" align="center"></el-table-column>
                <el-table-column prop="approvalNumber" label="批准文号" align="center"></el-table-column>
                <el-table-column prop="purchasePrice" label="采购价" align="center"></el-table-column>
                <el-table-column prop="purchasePrice" label="参考零售价" align="center"></el-table-column>
                <el-table-column label="操作" align="center">
                    <template slot-scope="{row,$index}">
                        <el-button
                            type="primary"
                            size="mini"
                            @click="addGoods(row)"
                            style="background:#e10202;border:1px solid #e10202"
                        >添加</el-button>
                    </template>
                </el-table-column>
            </elTable>
        </el-dialog>
    </div>
</template>
<script>
import apisFloorMessage from "@/api/shopDecoration/floorMessage"; //楼层管理列表接口
import elTable from "@/components/xForm/elTable";
export default {
    name: "dialogSelectGoods",
    components: { apisFloorMessage,elTable },
    data() {
        return {
            dialogFormVisible: false,
            dialogTitle: "",
             formData: {
                currentPage: 1,
                pageSize: 10,
            },
            dataInfo:[]
        };
    },
    methods: {
        open(data) {
            this.dialogFormVisible = true;
            let dataInfo = [
                {
                    goodsId: 1,
                    goodsName: "布洛芬缓释胶囊",
                },
            ];
            let total = 10;
            this.$nextTick(() => {
                this.$refs.dataInfo.loadData(dataInfo, total);
            });
        },
        //添加商品  商品id  哪个类型下的id：超级团购
        addGoods(){
           this.$parent.getList();
        }
    },
};
</script>
<style lang="" scoped>
</style>